<?php

namespace HelloWeb\LottoBundle\Service\LottoService;

use HelloWeb\LottoBundle\Entity\Repository\LottoRepository;

class LottoService{
    protected $entityManager;
    protected $lottoRepository;
    
    public function __construct(EntityManager $entityManager,LottoRepository $lottoRepository){
        $this->entityManager = $entityManager;
        $this->lottoRepository = $lottoRepository;
    }
    
    public function getAllLottos($searchArray = array(),$allowDeleted=false){
        return $this->lottoRepository->fetAll($searchArray,$allowDeleted);
    }
    
    public function saveLotto(\HelloWeb\LottoBundle\Entity\Lotto $lotto){
        $this->entityManager->persist($Lotto);
        $this->entityManager->flush();
    }

}